#include <iostream>
#include <vector>
#include <cstdio> 
#include <queue>

#define in read()
#define fi first
#define se second
#define pb push_back

using namespace std;

typedef long long ll;
typedef double db;
typedef vector < int >  vec;
typedef pair < int , int > pii;

int read() {
  int x = 0; bool f = 0; char ch = getchar(); while(!isdigit(ch)) f |= ch == '-',ch = getchar();
  while(isdigit(ch)) x = x * 10 + (ch ^ 48),ch = getchar(); return f ? -x : x;
}

const int N = 3010;

int a[N],b[N],n,stu[N];
int ans,p,s;
priority_queue < pii > q1,q2,q3,q4;

void add0(int x) {
    stu[x] = 0; q1.push({ a[x] , x }); q2.push({ b[x] , x }); 
}

void add1(int x) {
    stu[x] = 1; q3.push({ b[x] - a[x] , x });
}

void add2(int x) {
    stu[x] = 2; q4.push({ a[x] - b[x] , x });
}

void limit() {
    while(q1.size() && stu[q1.top().se] != 0) q1.pop();
    while(q2.size() && stu[q2.top().se] != 0) q2.pop();
    while(q3.size() && stu[q3.top().se] != 1) q3.pop();
    while(q4.size() && stu[q4.top().se] != 2) q4.pop(); 
}

int main() {
#ifndef ONLINE_JUDGE
    freopen("1.in","r",stdin);
#endif
    n = in,p = in,s = in;
    for(int i = 1;i <= n;i++) a[i] = in;
    for(int i = 1;i <= n;i++) b[i] = in;
    for(int i = 1;i <= n;i++) add0(i);
    while(p || s) {
	limit(); int mx = 0,res1 = -1e9,res2 = -1e9,res3 = -1e9,res4 = -1e9;
	if(p && q1.size()) res1 = q1.top().fi; 
	if(s && q2.size()) res2 = q2.top().fi;
	if(s && q1.size() && q3.size()) res3 = q1.top().fi + q3.top().fi;
	if(p && q2.size() && q4.size()) res4 = q2.top().fi + q4.top().fi;
	mx = max(res1,max(res2,max(res3,res4)));
	if(mx == res1) {
	    int x = q1.top().se; q1.pop(); add1(x); p--;
	} else if(mx == res2) {
	    int x = q2.top().se; q2.pop(); add2(x); s--;
	} else if(mx == res3) {
	    int x = q1.top().se,y = q3.top().se; q1.pop(); q3.pop(); s--;
	    add1(x); add2(y);
	} else if(mx == res4) {
	    int x = q2.top().se,y = q4.top().se; q2.pop(); q4.pop(); p--;
	    add2(x); add1(y);
	}
	ans += mx;
    } printf("%d\n",ans);
    for(int i = 1;i <= n;i++) if(stu[i] == 1) printf("%d ",i); puts("");
    for(int i = 1;i <= n;i++) if(stu[i] == 2) printf("%d ",i); puts("");
    return 0;
} 
